<?php
namespace Home\Controller;
use Think\Controller;

class TrainController extends PublicController {
    public function trainlist(){
        $train=M('train');
        $train=$train->select();
        $this->assign("train",$train);
        $this->display();
    }

     //删除培训：王子恒
    public function delete(){
        $id=$_GET['trainid'];
        $train=M('train');
        $train=$train->where("trainid=$id")->delete();
        if($train=1){
            $this -> success('删除成功！',U('trainlist'));
        }else{
            $this->error('删除失败！','');
        }
    }




}